package cn.yzc.client;


import cn.yzc.pojo.Good;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * <p>Project: SpringColud - GoodsRemoteClient</p>
 * <p>Powered by yzc On 2024-01-02 19:58:04</p>
 * <p>描述：<p>
 *
 * @author yzc [yzc0415@126.com]
 * @version 1.0
 * @since 17
 */
@FeignClient(value = "sc-good")
public interface GoodsRemoteClient {

    /**
     * 根据id查询商品详情
     * @param id
     * @return
     */
    @GetMapping("/goods")
    Map get(@RequestParam("id") String id);

    /**
     * 多参数传递
     * @param page
     * @param pageSize
     * @param name
     * @return
     */
    @PostMapping("/page")
    Map query(@RequestParam(value = "page",defaultValue = "1") int page,
              @RequestParam(value = "pageSize",defaultValue = "5") int pageSize,
              @RequestParam(value = "name") String name);

    @PostMapping("/page2")
    Map queryMap(@RequestParam Map map);

    /**
     * 接受json格式
     * @param good
     * @return
     */
    @PostMapping("/queryGood")
    Map queryGood(@RequestBody Good good);


    /**
     * URL地址传参
     * @param id
     * @return
     */
    @DeleteMapping("/Byid/{id}")
    Map queryId(@PathVariable("id") int id);


}
